feat(examples): add rsbuild-devframe-hub - #162
Open
antfubot wants to merge 1 commit into
Open
Conversation
A third reference hub host built on an Rsbuild (Rspack) dev server with a React browser UI, wearing the same shape as the Vite and Next hosts: an icon dock rail, an iframe stage, and a drawer of hub subsystems. The host is a small Rsbuild plugin that registers connect middleware and starts the side-car RPC/WS server; because rsbuild.config.ts runs in Node, the built-in plugins are imported directly like the Vite host. The JSON-render dock renders through the mini React registry shared verbatim with the Next hub example.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
examples/rsbuild-devframe-hub— a third reference hub host, alongside the Vite and Next examples. It hosts the@devframes/hubprotocol from an Rsbuild (Rspack) dev server with a React browser UI, wearing the same shape as the existing hosts: an icon dock rail, an iframe stage, and a subsystem drawer (commands / messages / terminals).The host (
src/rsbuild-devframe-hub.ts) is a small Rsbuild plugin that registers connect middleware inonBeforeStartDevServerand starts the side-car RPC/WS server. Becausersbuild.config.tsruns in Node — not through Rspack — the built-in plugins are imported directly, exactly like the Vite host, with no bundler-ignored dynamicimport()needed.It mounts the same set the Vite host does end-to-end: git, terminals, code-server, inspect, data-inspector, a11y, messages, og and assets, plus two demo SPAs, a shared-iframe tabbed tool, a server-authored JSON-render dock, and two client-only docks. The a11y agent is served same-origin via
DevframeHost.mountStatic(Rsbuild has no Vite/@fs/) and attached as the dock'sclientScript. Styling uses@unocss/postcss; the JSON-render dock renders through the mini React registry shared verbatim with the Next hub example.What's included
rsbuild-devframe-hub(host plugin, demo devframes, React client, SPAs,public/assets)@rsbuild/core+@rsbuild/plugin-reactadded to thebuildcatalogdocs/examples/rsbuild-devframe-hub.mdpageturbo.jsonbuild task (mirroring the Vite host's dependency list) and aknip.jsoncworkspace overrideVerification
pnpm --filter rsbuild-devframe-hub typecheck— passespnpm knip— passeseslint— passesrsbuild build— compiles the React client (workspace-source aliases +@antfu/designraw TS +@unocss/postcss)rsbuild dev— boots; verified/__hub/__connection.json, mounted SPAs, the same-origin a11y agent module, and instance-registry registration/teardownThis PR was created with the help of an agent.